package com.wangjiangfei;

import com.wangjiangfei.domain.ServiceVO;
import com.wangjiangfei.entity.Supplier;
import com.wangjiangfei.service.SupplierService;
import org.apache.shiro.SecurityUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MockMvcBuilder;
import org.springframework.web.context.WebApplicationContext;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RunWith(SpringRunner.class)
@SpringBootTest()//
public class JxcApplicationTests {
    @Resource//
    private SupplierService supplierService;//

    @Test
    public void testGetComboboxList() {
        List<Supplier> list = supplierService.getComboboxList("四川");
        System.out.println(list);
    }
    @Test
    public void testList() {
        Map<String, Object> list = supplierService.list(1, 5, "四川食萃食品有限公司");
        System.out.println(list);
    }
    @Test
    public void testSave() {
        Supplier supplier = new Supplier(13,"四川老干妈","张伟","17289765678","中国浙江杭州临安市玲珑街道上蟠龙桥2号","依托上海市场，聚焦在坚果炒货、炭烤海鲜、果脯蜜饯、果干脆片、特色糖果等五大核心领域");
        ServiceVO save = supplierService.save(supplier);
    }
    @Test
    public void testDelete() {
        supplierService.delete("1");
    }
}
